#ifndef _YOLOV8_POSE_H_
#define _YOLOV8_POSE_H_

#include <opencv2/opencv.hpp>
#include <onnxruntime_cxx_api.h>
#include "model_base.h"

struct PoseBox
{
    int x;
    int y;
    int w;
    int h;
    float score;
    int label;
    std::string label_name;

    //  结构体初始化
    PoseBox()
    {
        x = -1;
        y = -1;
        w = -1;
        h = -1;
        score = -1.0;
        label = -1;
        label_name = "";
    }

    bool IsValid() const
    {
        return x != -1 && y != -1 && w != -1 && h != -1 && score != -1.0 && label != -1 && label_name != "";
    }
};

struct PosePoint
{
    float x;
    float y;
    float visibility;
    PosePoint()
    {
        x = 0.0;
        y = 0.0;
        visibility = -1.0;
    }
};

struct PoseInfo
{
    PoseBox bbox;
    std::vector<PosePoint> poseV;
};

class Yolov8Pose : public ModelBase
{
public:
    Yolov8Pose();
    ~Yolov8Pose();

public:
    std::vector<PoseInfo> Inference(cv::Mat input_mat, float scale,
                                    std::vector<int> &padding,
                                    float score_threshold = 0.5,
                                    float iou_threshold = 0.5,
                                    float nms_threshold = 0.5);
};

#endif